home *** CD-ROM | disk | FTP | other *** search
/ 3D GFX / 3D GFX.iso / amiutils / i_l / irit5 / cagd_lib / bzr_gen.c < prev    next >
C/C++ Source or Header  |  1995-12-30  |  3KB  |  61 lines

  1. /******************************************************************************
  2. * Bzr-Gen.c - Bezier generic routines.                          *
  3. *******************************************************************************
  4. * Written by Gershon Elber, Mar. 90.                          *
  5. ******************************************************************************/
  6.  
  7. #include "cagd_loc.h"
  8.  
  9. /*****************************************************************************
  10. * DESCRIPTION:                                                               M
  11. * Allocates the memory required for a new Bezier surface.             M
  12. *                                                                            *
  13. * PARAMETERS:                                                                M
  14. *   ULength:      Number of control points in the U direction.               M
  15. *   VLength:      Number of control points in the V direction.               M
  16. *   PType:        Type of control points (E2, P3, etc.).                     M
  17. *                                                                            *
  18. * RETURN VALUE:                                                              M
  19. *   CagdSrfStruct *:   An uninitialized freeform Bezier surface.             M
  20. *                                                                            *
  21. * KEYWORDS:                                                                  M
  22. *   BzrSrfNew, allocation                                                    M
  23. *****************************************************************************/
  24. CagdSrfStruct *BzrSrfNew(int ULength, int VLength, CagdPointType PType)
  25. {
  26.     CagdSrfStruct *Srf = CagdSrfNew(CAGD_SBEZIER_TYPE, PType, ULength,
  27.                                 VLength);
  28.  
  29.     Srf -> UOrder = Srf -> ULength = ULength;
  30.     Srf -> VOrder = Srf -> VLength = VLength;
  31.  
  32.     Srf -> UKnotVector = Srf -> VKnotVector = NULL;
  33.  
  34.     return Srf;
  35. }
  36.  
  37. /*****************************************************************************
  38. * DESCRIPTION:                                                               M
  39. *   Allocates the memory required for a new Bezier curve.             M
  40. *                                                                            *
  41. * PARAMETERS:                                                                M
  42. *   Length:     Number of control points                                     M
  43. *   PType:      Type of control points (E2, P3, etc.).                       M
  44. *                                                                            *
  45. * RETURN VALUE:                                                              M
  46. *   CagdCrvStruct *:   An uninitialized freeform Bezier curve.               M
  47. *                                                                            *
  48. * KEYWORDS:                                                                  M
  49. *   BzrCrvNew, allocation                                                    M
  50. *****************************************************************************/
  51. CagdCrvStruct *BzrCrvNew(int Length, CagdPointType PType)
  52. {
  53.     CagdCrvStruct *Crv = CagdCrvNew(CAGD_CBEZIER_TYPE, PType, Length);
  54.  
  55.     Crv -> Order = Crv -> Length = Length;
  56.  
  57.     Crv -> KnotVector = NULL;
  58.  
  59.     return Crv;
  60. }
  61.